home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP02.ZIP / CHAP02 / SKEL / MAKEFILE < prev    next >
Text File  |  1993-06-22  |  3KB  |  116 lines

  1. #
  2. # MAKEFILE
  3. # CLASSLIB Skeleton
  4. #
  5. # Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  6. #
  7. # Kraig Brockschmidt, Software Design Engineer
  8. # Microsoft Systems Developer Relations
  9. #
  10. # Internet  :  kraigb@microsoft.com
  11. # Compuserve:  >INTERNET:kraigb@microsoft.com
  12. #
  13.  
  14. #Add '#' to the next line for 'noisy' operation
  15. !CMDSWITCHES +s
  16.  
  17. #
  18. #Compiler flags
  19. #Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
  20. #
  21. !ifndef RETAIL
  22. CFLAGS  = -c -nologo -Od -AM -Zipe -G2s -W3 -GA -GEs
  23. LINK    = /al:16/ONERROR:NOEXE/li/CO
  24. DEFS    = -DSTRICT -DDEBUG
  25. !else
  26. CFLAGS  = -c -nologo -Oas -AM -Zpe -G2s -W3 -GA -GEs
  27. LINK    = /al:16/ONERROR:NOEXE/li
  28. DEFS    = -DSTRICT
  29. !endif
  30.  
  31.  
  32. !ifdef SDI
  33. DOC     = -DSDI
  34. CLASSLIB= classSDI
  35. DIR     = SDI
  36. SRC_DIR = ..
  37. !else
  38. DOC     = -DMDI
  39. CLASSLIB= classMDI
  40. DIR     = MDI
  41. SRC_DIR = ..
  42. !endif
  43.  
  44.  
  45. .SUFFIXES: .h .obj .exe .cpp .res .rc
  46.  
  47. TARGET  = skel
  48.  
  49. goal:   cd_build $(TARGET).exe cd_src
  50.  
  51. cd_build:
  52.     cd $(DIR)
  53.  
  54. cd_src:
  55.     cd ..
  56.  
  57.  
  58. clean:
  59.     cd $(DIR)
  60.     del *.obj
  61.     del *.res
  62.     del *.exe
  63.     cd ..
  64.  
  65.  
  66. INCLS    =
  67. LIBS     = libw mlibcew commdlg bttncur gizmobar stastrip $(CLASSLIB)
  68.  
  69. OBJS1    = $(TARGET).obj
  70. OBJS     = $(OBJS1)
  71.  
  72.  
  73. RCFILES1 = $(SRC_DIR)\app.ico $(SRC_DIR)\document.ico $(SRC_DIR)\about.dlg
  74. RCFILES2 = $(SRC_DIR)\stdgz72.bmp $(SRC_DIR)\stdgz96.bmp $(SRC_DIR)\stdgz120.bmp
  75. RCFILES  = $(RCFILES1) $(RCFILES2)
  76.  
  77.  
  78.  
  79. #####
  80.  
  81. {$(SRC_DIR)}.cpp{}.obj:
  82.     echo ++++++++++
  83.     echo Compiling $*.cpp
  84.     cl $(CFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  85.  
  86.  
  87. {$(SRC_DIR)}.rc{}.res:
  88.     echo +++++++++
  89.     echo Compiling Resources
  90.     rc -r -i$(SRC_DIR) $(DEFS) $(DOC) -fo$@ $(SRC_DIR)\$*.rc
  91.  
  92.  
  93. #This rule builds a linker response file on the fly depending on debug flags
  94. $(TARGET).exe : $(OBJS) $(TARGET).res $(SRC_DIR)\$(TARGET).def
  95.     echo ++++++++++
  96.     echo Linking $@
  97.     echo +                                       > $(TARGET).lrf
  98.     echo $(OBJS1)                               >> $(TARGET).lrf
  99.  
  100.     echo $(TARGET) $(LINK)                      >> $(TARGET).lrf
  101.     echo nul/li                                 >> $(TARGET).lrf
  102.     echo $(LIBS) /NOD/NOE                       >> $(TARGET).lrf
  103.     echo $(SRC_DIR)\$(TARGET).def               >> $(TARGET).lrf
  104.  
  105.     link @$(TARGET).lrf
  106.     del $(TARGET).lrf
  107.     rc -v $(TARGET).res $(TARGET).exe
  108.  
  109.  
  110. ##### Dependencies #####
  111.  
  112. $(TARGET).res : $(SRC_DIR)\$(TARGET).rc     $(INCLS) $(RCFILES)
  113.  
  114. #Application level things
  115. $(TARGET).obj : $(SRC_DIR)\$(TARGET).cpp    $(INCLS)
  116.